<?php
require_once $_SERVER['DOCUMENT_ROOT'].'/common.php';

$items = troop::getAllItemTroop(1000);
foreach ($items as $item)
{
	$large = trim($item['item_image_l']);
	$t = explode("/", $large, 6);
	$file_name = array_pop($t);
	$o_dir = $t[1]."/o/".$t[3]."/".$t[4]."/";
	$up_file = $t[1]."/upload/".$file_name;
	$o_file = $o_dir.$file_name;
	if (file_exists($up_file) && !file_exists($o_file))
	{
		sys::tryMakeDir($o_dir);
		copy($up_file, $o_file);
		echo $o_file."<br>";
	}
}